package com.sky.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.pagehelper.Page;
import com.sky.dto.DishDTO;
import com.sky.dto.DishPageQueryDTO;
import com.sky.entity.Dish;
import com.sky.vo.DishVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DishMapper extends BaseMapper<Dish> {
    Page<DishVO> selectAll(DishPageQueryDTO dishPageQueryDTO);

    void deleteByIds(List<Integer> ids);



    DishVO select(Long id);

    void updateAll(Dish dish);

    @Select("select * from dish where category_id=#{categoryId} and status=1")
    List<Dish> selectByCategoryId(Long categoryId);

    @Select("select status from dish where id =#{id}")
    Integer selectStatusByDishId(Long id);
}
